﻿using Application.DTO;
using AutoMapper;
using Core.Entities;
using System.Security.Cryptography;

namespace Application
{
    public class MappingProfile: Profile
    {
        public MappingProfile()
        {
            CreateMap<UserLoginDTO, User>();
            CreateMap<User, UserLoginDTO>();
            CreateMap<User, UserInfo>();

            CreateMap<MenuDTO, Menu>();
            CreateMap<Menu, MenuDTO>();

            CreateMap<DepartmentDTO, Department>();
                
            CreateMap<Department, DepartmentDTO>()
                .ForMember(dest => dest.ManagerName, opt => opt.MapFrom(src => src.Manager.Name));
                //.ForMember(dest=>dest.Manager,opt=>opt.Ignore());

        }
    }
}
